1. Field of the Invention
The present invention relates to a method for accessing files in a management system, and more particularly, to a method for avoiding occurrence of asynchronous files, preventing data from damage, and maintaining normal operations.
2. Description of the Prior Art
To provide remote management services efficiently, the prior art provides a server using a system management device, so that managers can sustain or monitor the server in a control room via Internet at anytime and anyplace. Generally, the system management device usually provides functions such as KVM-over-IP, virtual storage (or named drive redirection and virtual media), and so on.
As for KVM-over-IP, KVM is an abbreviation of prefixes of Keyboard, Video, and Mouse, and means controlling 2˜4032 computers with a set of a keyboard, monitor, and mouse. KVM is operated directly by the managers. If the managers cannot get KVM, the managers will fail to solve problems of the server or configure the server immediately. KVM-over-IP is a new solution, which transmits KVM signals to a terminal-to-be-managed via Internet without limitation of distances, time, and personal factors, so that the managers can manage, control, and monitor the terminal-to-be-managed via Internet at anytime and anyplace to keep an eye on all situations and handle problems immediately.
As for the virtual storage, the concept of the virtual storage is similar to the KVM-over-IP. Please refer to FIG. 1. In FIG. 1, a system management device 104 simulates a virtual storage device 108, such as a floppy disk drive, a hard disk drive, or a CD-ROM drive, in a managed device 102 via a system management chip 110, and transmits data of a physical storage device 106 of a control device 100 to the managed device 102 via Internet. The managed device 102 regards the virtual storage device 108 as a physical storage device, and data of the virtual storage device 108 is the same as that of the physical storage device 106. In other words, the managed device 102 seems owning a storage device the same as the physical storage device 106, so that the managed device 102 can exchange data with the control device 100 without an Internet driver program. Correspondingly, the control device 100 includes a management program 112 for connecting with the system management device 104 via a network interface card 114, to load the physical storage device 106 into the managed device 102 or erase the physical storage device 106 from the managed device 102. As for operations of the system management device 104, please refer to the following description.
First, application programs access data of a disk by means of accessing files, and an operating system provides file access services in a hierarchical structure, which identifies locations of the files in the disk via a file system, and access data of the disk via a driver program. The operating system stores related data of the file system in a memory when booting, and writes data into the disk if updated. Therefore, if there is data written into the disk not via the file system of the operating system, the file system cannot recognize that files have been updated.
Please refer to FIG. 2 and FIG. 3. FIG. 2 is a schematic diagram when the managed device 102 shown in FIG. 1 reads a file from the virtual storage device 108, while FIG. 3 is a schematic diagram when the managed device 102 shown in FIG. 1 writes a file into the virtual storage device 108. In FIG. 2, when an application program of the managed device 102 reads a file of the virtual storage device 108, the application program outputs a request command to the system management device 104 through a route a1. That is, the application program reads the file of the virtual storage device 108 via a system call function of the operating system, and the operating system gains locations of the virtual storage device 108 corresponding to the file via the file system, so as to read the file from the virtual storage device 108 via a driver program. Next, the system management device 104 transmits the request command via Internet to the management program 112 of the control device 100 through a route a2. Then, the management program 112 reads the file from the physical storage device 106 through a route a3, and transmits the file back to the system management device 104 via Internet (namely, through the route a2), so as to accomplish the reading operation.
On the other hand, in FIG. 3, when the managed device 102 writes a file into the virtual storage device 108, the application program outputs a request command to the system management device 104 through a route b1. That is, the application program writes the file into the virtual storage device 108 via a system call function of the operating system, and the operating system will determine where to write the file into the virtual storage device 108 via the file system, so as to write the file into the virtual storage device 108 via a driver program. Next, the system management device 104 transmits the request command and the file-to-be-written via Internet to the management program 112 of the control device 100 through a route b2. Since the request command to write a file is a lower level instruction, information of the request command does not make the system management device 104 or the management program 112 to write the file into the physical storage device 106 via the file system of the operating system. Therefore, when the management program 112 receives the request command and the file-to-be-written, the management program 112 writes the file into the physical storage device 106 through a route b3 but not via the file system of the operating system. In other words, when the managed device 102 writes the file into the virtual storage device 108, the file system of the control device 100 can not recognize update of files of the physical storage device 106, causing problems of asynchronous files between the control device 100 and the managed device 102. In such a case, when other application programs of the control device 100 access the file of the physical storage device 106 through a route b4, data damage may happen, causing serious system errors.
Thus, to avoid the above-mentioned problems, the prior art usually restrains users of the control device 100 from accessing files of the physical storage device 106. In other words, the control device 100 and the managed device 102 cannot access the files of the physical storage device 106 bi-directionally, so that the application range is limited.